#ifndef AVALON_SOCKETTHREADPOOL_HPP
#define AVALON_SOCKETTHREADPOOL_HPP
#include <vector>
#define _WIN32_WINNT 0x0501
#include <boost/asio.hpp>
#pragma warning(disable : 4267)
#include <boost/thread.hpp>
#pragma warning(default : 4267)
#include "Avalon/Base/Singleton.hpp"

namespace Avalon {
namespace Network {
  class SocketThreadPool : private Singleton<SocketThreadPool> {
    public:

      virtual ~SocketThreadPool();

      boost::asio::io_service& GetService();

      using Singleton<SocketThreadPool>::GetInstance;

    private:
      friend class Singleton<SocketThreadPool>;
      boost::asio::io_service m_service;
      boost::scoped_ptr<boost::asio::io_service::work> m_work;
      std::vector<boost::thread*> m_threads;
      SocketThreadPool();
  };
}
}

#endif // AVALON_SOCKETTHREADPOOL_HPP
